<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性布局-对齐方式</title>
    <style>
        .container{
            width: 800px;
            height: 700px;
            background: pink;
            border: 5px solid skyblue;
            margin:  50px auto;
            display: flex;
            /* 复合属性 */
            flex-flow: row wrap;

            /* 主轴对齐方式 */
            /* 默认值：左对齐 */
            /* justify-content: flex-start; */
            /* 右对齐 */
            /* justify-content: flex-end; */
            /* 居中对齐 */
            /* justify-content: center; */

            /* 空白被均分 ,盒子与边框的空白是盒子之间的空白的一半*/
            /* justify-content: space-around; */

            /* 盒子与边款没有空白，盒子之间均分空白 */
            /* justify-content: space-between; */

            /* 盒子与边框之间的空白与盒子之间的空白一致 */
            /* justify-content: space-evenly; */


            /* 交叉轴对齐方式 */
            /* align-items: flex-start; */
            /* align-items: flex-end; */
            /* align-items: stretch; */

            /* 空白被均分 ,盒子与边框的空白是盒子之间的空白的一半*/
            /* align-items: center ; */

            /* 项目的第一行文字的基线对齐 */

            align-items: baseline;
        }
        .box{
            width:130px;
            height: 130px;
            font-size: 40px;
            text-align: center;
            background: green;
            color: #FFF;
            border: 2px solid gold;
            /* margin: 10px; */
        }
        .box2{
           font-size: 12px;
        }
        .box3{
           font-size: 100px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="box box1">1</div>
        <div class="box box2">2</div>
        <div class="box box3">3</div>
        <div class="box box4">4</div>
        <div class="box box5">5</div>
        <div class="box box6">6</div>
        <div class="box box7">7</div>
        <div class="box box8">8</div>
        <div class="box box9">9</div>
        <div class="box box10">10</div>
        <div class="box box11">11</div>
        <div class="box box12">12</div>
        <div class="box box13">13</div>
        <div class="box box14">14</div>
        <div class="box box15">15</div>
        <div class="box box16">16</div>
        <div class="box box17">17</div>
        <div class="box box18">18</div>
        <div class="box box19">19</div>
        <div class="box box20">20</div>
    </div>

    <div class="demo"></div>
</body>

</html>